home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / psgui130.zip / PGUI.PAS < prev    next >
Pascal/Delphi Source File  |  1993-01-01  |  17KB  |  436 lines

  1. {
  2.  
  3.                                                       ╔══════════════════╗
  4.                                                       ║    Pure Power    ║
  5.                                                       ║   VGA Graphical  ║
  6.                                                       ║   User Interface ║
  7.                                                       ║    Rev. 1.30     ║
  8.                                                       ╚══════════════════╝
  9.  
  10. }
  11.  
  12. {$F+} {$O-} {$A+} {$G+}
  13. {$V-} {$B-} {$X-} {$N+} {$E+}
  14.  
  15. {$I FINAL.PAS}
  16.  
  17. {$IFDEF FINAL}
  18.   {$I-} {$R-}
  19.   {$D-} {$L-} {$S-}
  20. {$ENDIF}
  21.  
  22. Unit PGUI;
  23.  
  24. { ╔════════════════════════════════════════════════════════════════════════╗}
  25. { ║                                                                        ║}
  26. { ║  Pure Power VGA Object Orientated Graphical User Interface             ║}
  27. { ║                                                                        ║}
  28. { ║  This unit controls Super VGA modes and mouse.  The unit requires      ║}
  29. { ║  Turbo Pascal Version 6 and Genius Mouse Driver Version 9.06 or later. ║}
  30. { ║                                                                        ║}
  31. { ║   Written by      : Michael Gallias                                    ║}
  32. { ║   Last Update     : 16 December 1992                                   ║}
  33. { ║                                                                        ║}
  34. { ╚════════════════════════════════════════════════════════════════════════╝}
  35.  
  36. Interface
  37.  
  38. Uses Graph,CRT,DOS,Dirs,Strings,KeyDef,Icons,PGUIMDef,PGUIMSE,PGUIBMSE;
  39.  
  40. Type {From MouseDef}
  41.  
  42.   BGIMouseShapePtr         = ^BGIMouseShape;
  43.  
  44.   BGIMouseShape            = Record
  45.                                Picture   :Pointer;
  46.                                Mask      :Pointer;
  47.                                XHot      :Integer;
  48.                                YHot      :Integer;
  49.                              End;
  50.  
  51.   STDMouseShapePtr         = ^STDMouseShape;
  52.  
  53.   STDMouseShape            = Record
  54.                                Picture   :Array[1..32] of Byte;
  55.                                Mask      :Array[1..32] of Byte;
  56.                                XHot      :Integer;
  57.                                YHot      :Integer;
  58.                              End;
  59.  
  60.  
  61. Type
  62.  
  63.   HideOrShow      = (Hidden,Visible);
  64.  
  65.   OutLineSave     = Record                            {Screen Save when dragging}
  66.                       Size1,                          {graphics box}
  67.                       Size2 :Word;
  68.                       Data  :Array[1..4] Of Pointer;
  69.                     End;
  70.  
  71.   ButtonListPtr = ^ButtonList;                   {Buttons to click on}
  72.  
  73.   ButtonList = Record
  74.                  X1,Y1,X2,Y2:Word;               {Screen Co-ordinate}
  75.                  Thickness  :Word;               {How thick it is}
  76.                  Background :Word;               {Background it lies on}
  77.                  Special    :Boolean;            {Keyboard Keys}
  78.                  Key        :Char;               {Keyboard Character}
  79.                  Picture    :Pointer;            {If it has a Picture}
  80.                  Name       :String[11];         {If it has a Name}
  81.                  Number     :Word;               {It's own Unique Number}
  82.                  Next       :ButtonListPtr;      {Next Button in Linked List}
  83.                End;
  84.  
  85.   ButtonChain     = Object
  86.                       Total          :Word;
  87.  
  88.                       Procedure Init;
  89.                       Function  Position     :Word;
  90.                       Function  Number       :Word;
  91.                       Procedure GotoPosition (Here:Word);
  92.                       Procedure GotoNumber   (ButtonNumber:Word);
  93.  
  94.                       Procedure DrawUp       (ButtonNumber:Word);
  95.                       Procedure DrawDown     (ButtonNumber:Word);
  96.  
  97.                       Procedure Add          (X1, Y1, X2, Y2:Word;
  98.                                               Thickness, Background:Word;
  99.                                               Picture:Pointer; Name:String;
  100.                                               Special:Boolean; Key:Char);
  101.  
  102.  
  103.                       Procedure Move         (X, Y:Integer;
  104.                                               ButtonNumber:Word);
  105.  
  106.                       Procedure MoveAll      (X, Y:Integer);
  107.  
  108.                       Procedure Create       (X1, Y1, X2, Y2:Word;
  109.                                               Thickness, Background:Word;
  110.                                               Picture:Pointer; Name:String;
  111.                                               Special:Boolean; Key:Char);
  112.  
  113.                       Procedure WaitForClick (Var X, Y:Word;Var MouseButtons:Byte;
  114.                                               Var Held,Doubled,Special:Boolean;
  115.                                               Var Key:Char);
  116.  
  117.                       Procedure KillAll;
  118.                       Procedure KillFrom;
  119.                       Procedure KillOne;
  120.  
  121.                       Private
  122.  
  123.                       Root           :Pointer;
  124.                       Buttons        :ButtonListPtr;
  125.  
  126.                       Function NewButtonNumber:Word;
  127.  
  128.                     End;
  129.  
  130.   MouseFunctions  = Object
  131.                       Init       :MouseProc_Init;
  132.                       Show       :MouseProc_Show;
  133.                       Hide       :MouseProc_Hide;
  134.                       SetSpeed   :MouseProc_SetSpeed;
  135.                       SetXY      :MouseProc_SetXY;
  136.                       SetBounds  :MouseProc_SetBounds;
  137.                       SetShape   :MouseProc_SetShape;
  138.                       GetPresses :MouseProc_GetPresses;
  139.                       GetXY      :MouseProc_GetXY;
  140.                       GetStatus  :MouseProc_GetStatus;
  141.                       GetClick   :MouseProc_GetClick;
  142.  
  143.                       Function  ComputerSpeed:LongInt;
  144.                       Function  Active       :Boolean;
  145.  
  146.                     End;
  147.  
  148.   GraphicWindow   = Object
  149.                       HdrButtonNum,                   {Button Numbers}
  150.  
  151.                       VSlideButtonNum,                {The Little Button}
  152.                       VSlideBarButtonNum,             {The Bar as a Button}
  153.                       VSlideButtonUpNum,
  154.                       VSlideButtonDownNum,
  155.  
  156.                       HSlideButtonNum,
  157.                       HSlideBarButtonNum,
  158.                       HSlideButtonLeftNum,
  159.                       HSlideButtonRightNum,
  160.  
  161.                       CloseButtonNum :Word;
  162.                       Buttons        :ButtonChain;   {The window's buttons}
  163.                       VSlideBarCurPos:LongInt;
  164.                       HSlideBarCurPos:LongInt;
  165.  
  166.                       Status         :HideOrShow;    {Visible or Not}
  167.                       KeepBack       :Boolean;       {Background Saved or Not}
  168.                       Thickness      :Byte;          {Box Outline}
  169.                       Pattern,                       {Pascal Pattern Number}
  170.                       FillColor,                     {Pattern Colour}
  171.                       HdrPattern,                    {Heading Background Pattern}
  172.                       HdrFillColor,                  {Heading Pattern Colour}
  173.                       HdrFrg,                        {Header Text Forg}
  174.                       BoxFrg,                        {Box Colour}
  175.                       BoxBck,                        {Box Backgound OutLine}
  176.                       Size,                          {Memory Required for Save}
  177.                       X1,Y1,                         {Location on Screen}
  178.                       X2,Y2          :Word;
  179.                       Header         :String;        {Heading Text}
  180.                       HdrFmt         :TextFormats;   {Heading Format}
  181.                       VSlideBarPat,
  182.                       VSlideBarClr,
  183.                       VSlideButtonPos:Word;
  184.  
  185.                       VSlideBarMaxPos:LongInt;
  186.  
  187.                       HSlideBarPat,
  188.                       HSlideBarClr,
  189.                       HSlideButtonPos:Word;
  190.  
  191.                       HSlideBarMaxPos:LongInt;
  192.  
  193.  
  194.                       Procedu